//
//  CTEmojiCell.m
//  ConstellationTalk_0.1
//
//  Created by riley on 15/6/12.
//  Copyright (c) 2015年 riley chu. All rights reserved.
//

#import "CTEmojiCell.h"
#import "CTDebugManager.h"
#import "CTHeader.h"
#import "CTRequestUtil.h"

@interface CTEmojiCell()
{
    UIImageView         *picImageView;
}

@end

@implementation CTEmojiCell

- (void)dealloc
{
    [CTDebugManager showDebugLogInfo:@"dealloc : CTEmojiDetailsCollection Is Removed!!!"];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIView * backgroundView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 80, 74)];
        backgroundView.backgroundColor = CT_HEADER_WHITE_COLOR;
        UIView * selectedBackgroundView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 80, 74)];
        selectedBackgroundView.backgroundColor =  [UIColor colorWithRed:0 green:0 blue:0 alpha:0.16];
        self.backgroundView = backgroundView;
        self.selectedBackgroundView = selectedBackgroundView;
        picImageView = [[UIImageView alloc] initWithFrame:CGRectMake(21.5, 19, 37, 37)];
        picImageView.image = [UIImage imageNamed:@"head"];

        [self addSubview:picImageView];
    }
    return self;
}
#pragma mark -setter-
- (void)setPicImageView:(NSString *)imgUrl
{
    [CTRequestUtil requestImgWithUrl:imgUrl withCompletionSuccessHandler:^(UIImage *img) {
        picImageView.image = img;
    } withFailedHandler:^(NSError *error) {
        
    }];
    
}

-(void)setImg:(UIImage *)img
{
    picImageView.image = img;
}

@end
